import networkx as nx


def create_graph(file_path):
    # Open the text file for reading
    with open(file_path, 'r') as f:
        # Create an empty graph
        G = nx.Graph()

        # Loop through each line in the file
        for line in f:
            # Skip lines starting with a comment character
            if line.startswith('#'):
                continue
            # Split the line into two nodes
            nodes = line.strip().split()
            # Check for self-loops and multiple edges
            if nodes[0] != nodes[1] and not G.has_edge(nodes[0], nodes[1]):
                # Add an edge between the two nodes
                G.add_edge(nodes[0], nodes[1])
    return G
